home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / QuickDraw / RotateString / CRotate ƒ / rotateSampleMain.c next >
Encoding:
C/C++ Source or Header  |  1994-02-09  |  1.4 KB  |  62 lines  |  [TEXT/KAHL]

  1. #ifndef BUILD_LIBRARY
  2.  
  3. #include "RotateString.h"
  4.  
  5. #define    NIL_POINTER            0L
  6. #define REMOVE_ALL_EVENTS    0
  7. #define VISIBLE                TRUE
  8. #define    MOVE_TO_FRONT        (Ptr)-1
  9. #define HAS_GOAWAY            TRUE
  10.  
  11. void    main()
  12. {
  13.     WindowPtr    window1,window2;
  14.     BitMap        destMap;
  15.     Rect        windowRect;
  16.     
  17.     InitGraf( &thePort);
  18.     InitFonts();
  19.     FlushEvents( everyEvent, REMOVE_ALL_EVENTS);
  20.     InitWindows();
  21.     InitMenus();
  22.     TEInit();
  23.     InitDialogs( NIL_POINTER);
  24.     InitCursor();
  25.  
  26.     
  27.     
  28.     SetRect( &windowRect, 100, 100, 200, 200);
  29.     
  30.     window1 = NewWindow( NIL_POINTER, &windowRect, "\pCounter CW", VISIBLE,
  31.                 noGrowDocProc,(WindowPtr)-1, HAS_GOAWAY, NIL_POINTER);
  32.  
  33.     SetPort(window1);
  34.     TextFont(4);
  35.     //TextFace(bold+italic);
  36.     TextSize(96);
  37.     
  38.     RotateString( "\pRotatey", &destMap, counterClockWise);
  39.     SizeWindow(window1,destMap.bounds.right,destMap.bounds.bottom,false);
  40.  
  41.     CopyBits( &destMap, &window1->portBits, &destMap.bounds,
  42.              &destMap.bounds, srcCopy, NIL_POINTER);
  43.     
  44.     OffsetRect(&windowRect,(windowRect.right - windowRect.left ) + 40,0);
  45.     window2 = NewWindow( NIL_POINTER, &windowRect, "\pClock Wise", VISIBLE,
  46.                 noGrowDocProc,(WindowPtr) MOVE_TO_FRONT, HAS_GOAWAY, NIL_POINTER);
  47.  
  48.     SetPort(window2);
  49.     TextFont(4);
  50.     //TextFace(bold+italic);
  51.     TextSize(96);
  52.     
  53.     RotateString( "\pRotate", &destMap, clockWise);
  54.     SizeWindow(window2,destMap.bounds.right,destMap.bounds.bottom,false);
  55.  
  56.     CopyBits( &destMap, &window2->portBits, &destMap.bounds,
  57.              &destMap.bounds, srcCopy, NIL_POINTER);
  58.  
  59.     while( !Button());
  60. }
  61.  
  62. #endif